﻿using Chromium;
using Chromium.WebBrowser;
using M5.GeminiHybird.Core.Config;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace M5.GeminiHybird.Core
{
    public class M5Launcher
    {
        public static void Start(Action<JavascriptConfig, SchemeConfig> initAction = null)
        {
            ChromiumWebBrowser.Initialize();


            XHR.HttpServer server = new XHR.HttpServer();
            server.Start();


            initAction?.Invoke(JavascriptConfig.Instance, SchemeConfig.Instance);
        }



        public static void Stop()
        {
            //System.Environment.Exit(0);
            CfxRuntime.Shutdown();
        }
    }


}
